package service

import (
	"ruoyi-go/internal/web/system/domain"
	"strings"
)

// SelectPostNamesByUsername 查询用户的岗位组
func SelectPostNamesByUsername(username string) string {
	list := domain.SysPostModel().SelectPostNamesByUsername(username)
	// 转为字符串拼接后返回
	var builder strings.Builder
	for i, post := range list {
		if i > 0 {
			builder.WriteString(",")
		}
		builder.WriteString(post.PostName)
	}
	return builder.String()
}
